import { createRouter, createWebHistory } from 'vue-router'
import HouseView from '@/App.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    // 首页
    {
      path: '/',
      name: 'house',
      redirect: '/search',
      component: HouseView,
    },
    // 登录
    {
      path: '/login',
      name: 'login',
      component: () => import('@/views/login/index.vue'),
    },
    // 搜索
    {
      path: '/search',
      name: 'search',
      component: () => import('@/views/search/index.vue'),
    },
    // 首页
    {
      path: '/home',
      name: 'home',
      component: () => import('@/views/layout/index.vue'),
    },
    // 栏目
    {
      path: '/column',
      name: 'column',
      redirect: '/threeplanet',
      component: () => import('@/views/column/index.vue'),
      children: [
        // 3d页
        {
          path: '/threeplanet',
          name: 'threeplanet',
          component: () => import('@/views/column/threeplanet.vue'),
        },
      ],
    },
    // 编辑页
    {
      path: '/edit',
      name: 'edit',
      component: () => import('@/views/edit/index.vue'),
    },
    // 详情页
    // 修改页
    {
      path: '/ed',
      name: 'ed',
      component: () => import('@/views/ed/index.vue'),
    },
    {
      path: '/garden',
      name: 'garden',
      component: () => import('@/views/garden/index.vue'),
    },
    // 百宝箱
    {
      path: '/chest',
      name: 'chest',
      component: () => import('@/views/chest/index.vue'),
      children: [
        // 友情链接
        {
          path: '/flink',
          name: 'flink',
          component: () => import('@/views/chest/flink.vue'),
        },
        // 收藏夹
        {
          path: '/favorite',
          name: 'favorite',
          component: () => import('@/views/chest/favorite.vue'),
        },
      ],
    },
    // 特效库
    {
      path: '/vfx',
      name: 'vfx',
      component: () => import('@/views/vfx/index.vue'),
    },

    // 时间线
    {
      path: '/timeline',
      name: 'timeline',
      component: () => import('@/views/timeline/index.vue'),
    },
    // 相册
    {
      path: '/photo',
      name: 'photo',
      component: () => import('@/views/photo/index.vue'),
    },
    // 留言
    {
      path: '/leave',
      name: 'leave',
      component: () => import('@/views/leave/index.vue'),
    },
    // {
    //   path: '/about',
    //   name: 'about',
    //   // route level code-splitting
    //   // this generates a separate chunk (About.[hash].js) for this route
    //   // which is lazy-loaded when the route is visited.
    //   component: () => import('../views/AboutView.vue')
    // }
  ],
})

export default router
